/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package boundary;

import entity.DaftarMember;
import javax.servlet.http.HttpServletRequest;

/**
 *
 * @author Sonnavy
 */
public class DaftarMemberServletLogic {

    HttpServletRequest request;
    

    public DaftarMemberServletLogic(HttpServletRequest request) {
        this.request = request;
    }

    public String signUp() {
        DaftarMember user = new DaftarMember();
        //DaftarMemberTable daf = new DaftarMemberTable();
        //HttpSession session = request.getSession();

        String nama = request.getParameter("username");
        //boolean hasilCheck = daf.check(nama);
        
        user.setUsername(nama);
        String kunci = request.getParameter("password");
        user.setPassword(kunci);
        String depan = request.getParameter("nama_depan");
        user.setNamaDepan(depan);
        String belakang = request.getParameter("nama_belakang");
        user.setNamaBelakang(belakang);
        String panggil = request.getParameter("nama_panggil");
        user.setNamaPanggil(panggil);
        String status = request.getParameter("status");
        user.setStatus(status);
        String alamat = request.getParameter("alamat");
        user.setAlamat(alamat);
        String kota = request.getParameter("kota");
        user.setKota(kota);
        String provinsi = request.getParameter("provinsi");
        user.setProvinsi(provinsi);
        String kodepos = request.getParameter ("kodepos");
        user.setKodepos(kodepos);
        String teleponhp = request.getParameter("teleponHp");
        user.setTeleponHp(teleponhp);
        String email = request.getParameter("email");
        user.setEmail(email);
        
        
        
        
        //daf.create(user);
        return "index.jsp";
        
        
        
       // String password = request.getParameter("password");
        //user.setPassword(password);
        //return "index.jsp";

        /*if (nama.equals("")) {
        return "error.jsp";
        } else {
        if (!hasilCheck) {
        user.setUsername(nama);
        
        daf.create(user);
        return "index.jsp";
        
        } else {
        return "index.jsp";
        }
        }*/
    }
}
